﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RoketPack.Management.Objects
{
    abstract class Object
    {
        protected List<Variable> p_Variables = null;
        private int p_AvailableVersion = -1;
        private int p_InstalledVersion = -1;
        private bool p_DeleteOnNextUpdate = false;

        internal abstract bool Download(Installation installation, RoketPack.Manager.VoidLambdaDouble progressevent);
        internal abstract bool Install(Installation installation);
        internal abstract bool Uninstall(Installation installation);
        internal abstract bool Update(Installation installation);
        internal abstract bool DownloadRequired(Installation installation);

        internal int AvailableVersion
        {
            get
            {
                return this.p_AvailableVersion;
            }
            set
            {
                this.p_AvailableVersion = value;
            }
        }

        internal int InstalledVersion
        {
            get
            {
                return this.p_InstalledVersion;
            }
            set
            {
                this.p_InstalledVersion = value;
            }
        }

        internal List<Variable> Variables
        {
            set
            {
                this.p_Variables = value;
            }
        }

        internal bool DeleteOnNextUpdate
        {
            get
            {
                return this.p_DeleteOnNextUpdate;
            }
            set
            {
                this.p_DeleteOnNextUpdate = value;
            }
        }
    }
}
